<template>
  <div>
    <div>我是子组件 {{money}}</div>
    <hr>
    <GrandSon></GrandSon>
  </div>
</template>

<script>
import { inject, onMounted } from 'vue'
import GrandSon from './GrandSon6.vue'
export default {
  name: 'Son',
  components: {
    GrandSon
  },
  setup () {
    // 接收祖先provide
    const money = inject ('money')

    return {money}
  }
}
</script>

<style>

</style>